import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int x=0,y=0;
        int[] red=new int[33];
        int[] blue=new int[16];
        for (int i=0;i<= red.length-1;i++){
            red[i]=i+1;
        }
        for (int i=0;i<= blue.length-1;i++){
            blue[i]=i+1;
        }
        System.out.println("已生成中奖号码");
        int[] a= WinNumber.createWinNumberRed();
        int n=WinNumber.createWinNumberBlue();
        Scanner scanner=new Scanner(System.in);
        System.out.println("请选择你的选号方式：机选/自选");
        String str=scanner.nextLine();
        if (str.equals("自选")){
            SelectNumber selectNumber=new SelectNumber();
             x=selectNumber.selectSelfRed(red,a);
             y=selectNumber.selectSelfBlue(blue,n);
            if (x==6&&y==1){
                System.out.println("恭喜你中了一等奖");
            }else if (x==6&&y==0){
                System.out.println("恭喜你中了二等奖");
            }else if (x==5&&y==1){
                System.out.println("恭喜你中了三等奖");
            }else if (x==5&y==0){
                System.out.println("恭喜你中了四等奖");
            }else if (x==4&&y==1){
                System.out.println("恭喜你中了四等奖");
            }else if (x==4&&y==0){
                System.out.println("恭喜你中了五等奖");
            }else if (x==3&&y==1){
                System.out.println("恭喜你中了五等奖");
            }else if (x==2&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else if (x==1&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else if (x==0&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else {
                System.out.println("很遗憾~你本轮抽奖没有中奖");
            }
        }else if (str.equals("机选")){
            SelectNumber selectNumber=new SelectNumber();
           x= selectNumber.selectComputerRed(a);
           y= selectNumber.selectCompoterBlue(n);
            if (x==6&&y==1){
                System.out.println("恭喜你中了一等奖");
            }else if (x==6&&y==0){
                System.out.println("恭喜你中了二等奖");
            }else if (x==5&&y==1){
                System.out.println("恭喜你中了三等奖");
            }else if (x==5&y==0){
                System.out.println("恭喜你中了四等奖");
            }else if (x==4&&y==1){
                System.out.println("恭喜你中了四等奖");
            }else if (x==4&&y==0){
                System.out.println("恭喜你中了五等奖");
            }else if (x==3&&y==1){
                System.out.println("恭喜你中了五等奖");
            }else if (x==2&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else if (x==1&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else if (x==0&&y==1){
                System.out.println("恭喜你中了六等奖");
            }else {
                System.out.println("很遗憾~你本轮抽奖没有中奖");
            }
        }else {
            System.out.println("输入有误，请重新输入！");
        }

    }
}
